package demo001.testB;



public class Student {
	//此处如果不加static 会 StackOverflowError
	public static Student student01 =new Student();
	public void StudyMath(){
		System.out.println("Study Math");
	}
	
	public void StudyEnglish(){
		System.out.println("Study English");
	}
	public void StudyChinese(){
		System.out.println("Study Chinese");
	}
	
	/***
	 * switch case的用法
	 * @param value
	 */
	public void study(String value){
		switch (value) {
		case "MathA":
        case "MathB":
		case "Math":
        	System.out.println("Study Math");
        	return;
        case "Chinese":
        	System.out.println("Study Chinese");
        	return;
        case "English":
        	System.out.println("Study English");
        	return;
        default:
        	System.out.println("Study Other");
        	return;
        }
	}
	
}
